package com.kornero.geek.activity.intro;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import com.kornero.geek.R;
import com.kornero.geek.activity.game.MainActivity;

public class IntroMenuActivity extends Activity implements View.OnClickListener {

    private static final String TAG = IntroMenuActivity.class.getCanonicalName();

    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.intro_menu);

        findViewById(R.id.new_game_button).setOnClickListener(this);
        findViewById(R.id.load_game_button).setOnClickListener(this);
        findViewById(R.id.exit_game_button).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.new_game_button:
                startActivity(new Intent(this, EnterNewPlayerNameActivity.class));
                break;
            case R.id.load_game_button:

                // Game will use SharedProperties.
                startActivity(new Intent(this, MainActivity.class));
                break;
            case R.id.exit_game_button:
                finish();
                break;
            default:
                Log.wtf(TAG, "Unsupported id: " + v.getId());
        }
    }
}
